//
//  LKMonitorVideoPlayerViewController.m
//  LKIntelligentVideoProject
//
//  Created by she1323 on 2018/10/18.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKMonitorVideoPlayerViewController.h"
//#import <Mcu_sdk/RealPlayManager.h>
//#import <Mcu_sdk/RealPlayManagerEx.h>
//#import <Mcu_sdk/PlayBackManager.h>

//static NSString * const kPlayUrl = @"rtsp://admin:admin12345@116.236.106.10:18008/h264/ch33/main/av_strrtsp://admin:admin12345@116.236.106.10:18008/h264/ch33/main/av_streameam"

static NSString * const kPlayUrl = @"rtsp://218.77.102.231:554/pag://100.100.1.241:7302:f6f3616cd679455bba4299eed0915aba:0:MAIN:TCP?cnid=4&pnid=6";




//@interface LKMonitorVideoPlayerViewController ()<RealPlayManagerExDelegate
//>

@interface LKMonitorVideoPlayerViewController ()
//@property (nonatomic, strong) RealPlayManagerEx *playManager;
//
//@property(nonatomic,strong)PlayBackManager *backPlayManager;

@property (nonatomic, strong) UIActivityIndicatorView *activityView;

@property(nonatomic,strong)UIView *playView;
@end

@implementation LKMonitorVideoPlayerViewController


- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
//    [self.playManager stopRealPlay];
}


- (void)viewDidLoad {
    [super viewDidLoad];
//    NSString *st = [NSString stringWithFormat:@"%@%@%@",@"rtsp://admin:admin12345",@"@",@"116.236.106.10:18008/h264/ch33/main/av_stream"];
//    WS(weakSelf)
//     [self.activityView startAnimating];
//
//    _playManager = [[RealPlayManagerEx alloc] initWithDelegate:self];//初始化
//
//    [_playManager startRealPlay:kPlayUrl playView:self.playView complete:^(BOOL finish, NSString *message) {
//        if (!finish) {
//#warning 刷新UI必须在主线程操作，如果finish为YES，以回调realPlayCallBackEx:realManager:这个方法的回调信息为准
//            dispatch_async(dispatch_get_main_queue(), ^{
//                [weakSelf.activityView stopAnimating];
//
//            });
//        }
//        NSLog(@"%@",message);
//    }];
    // Do any additional setup after loading the view.
}
//#pragma mark - RealPlayManagerExDelegate
//-(void)realPlayCallBackEx:(PLAY_STATE)playState realManager:(RealPlayManagerEx *)realPlayManager{
//    switch (playState) {
//        case PLAY_STATE_PLAYING: {//正在播放
//            [_activityView stopAnimating];
//            NSLog(@"playing");
//            break;
//        }
//        case PLAY_STATE_STOPED: {//停止播放
//            NSLog(@"stoped");
//            break;
//        }
//        case PLAY_STATE_STARTED: {//开始播放
//            NSLog(@"started");
//            break;
//        }
//        case PLAY_STATE_FAILED: {//播放失败
//            NSLog(@"failed");
//            break;
//        }
//        case PLAY_STATE_EXCEPTION: {//播放异常
//            NSLog(@"exception");
//            break;
//        }
//        default:
//            break;
//    }
//
//}
//
//- (UIActivityIndicatorView *)activityView {
//    if (!_activityView) {
//        _activityView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
//        _activityView.hidesWhenStopped = YES;
//    }
//    return _activityView;
//}
//
//-(UIView *)playView{
//    if (!_playView) {
//        _playView = [[UIView alloc] initWithFrame:CGRectMake(0, NAVIGATION_BAR_HEIGHT, WIDTH, WIDTH * 9 / 16)];
//        [self.view addSubview:_playView];
//    }
//    return _playView;
//}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
